package com.cdyx.outsideprescription.BO;

import com.cdyx.outsideprescription.config.PrescriptionUploadConfig;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.io.Serializable;

@Data
@Component
public class PrecriptionInfoBo implements Serializable {
        @Autowired
        private PrescriptionUploadConfig prescriptionUploadConfig;
        private String url;
        public synchronized PrecriptionInfoBo newPrecriptionInfoBo(String sign){
            PrecriptionInfoBo precriptionInfoBo=new PrecriptionInfoBo();
            if ("3.1".equals(sign)){
                    precriptionInfoBo.setUrl(prescriptionUploadConfig.getAddVisitInfo());
            }else if ("3.2".equals(sign)){
                    precriptionInfoBo.setUrl(prescriptionUploadConfig.getAddRecipeInfo());
            }else if ("3.3".equals(sign)){
                    precriptionInfoBo.setUrl(prescriptionUploadConfig.getCancelRecipeInfo());
            }else if ("3.4".equals(sign)){
                    precriptionInfoBo.setUrl(prescriptionUploadConfig.getUploadFile());
            }else if ("3.5".equals(sign)){
                    precriptionInfoBo.setUrl(prescriptionUploadConfig.getGetMedicineInventory());
            }else if ("3.6".equals(sign)){
                    precriptionInfoBo.setUrl(prescriptionUploadConfig.getRevoke());
            }
        return  precriptionInfoBo;

    }
}
